/**
 * 
 */
package com.jw.server.model;

import javax.persistence.Entity;

import cn.ydx.protobuf.OTIpcDef;





/**
 * @author Jason Biao
 *
 *         网约车车辆基本信息接口
 */
@Entity
public class BaseInfoVehicle extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8474413872179548789L;

	private int address;

	private String vehicleNo;

	private String plateColor;

	private String seats;

	private String brand;

	private String model;

	private String vehicleType;

	private String ownerName;

	private String vehicleColor;

	private String engineId;

	private Long vin;

	private int certifyDateA;

	private String fuelType;

	private String engineDisplace;

	private String transAgency;

	private String transArea;

	private int transDateStart;

	private int transDateStop;

	private int certifyDateB;

	private String fixState;

	private int checkState;

	private String feePrintId;

	private String gpsBrand;

	private String gpsModel;

	private int gpsInstallDate;

	private int registerDate;

	private int commercialType;

	private String fareType;

	private int state;
	
	private String photoId;
	
	private String certificate;
	
	private String gpsImei;
	
	public String getPhotoId() {
		return photoId;
	}

	public void setPhotoId(String photoId) {
		this.photoId = photoId;
	}

	public String getCertificate() {
		return certificate;
	}

	public void setCertificate(String certificate) {
		this.certificate = certificate;
	}

	public String getGpsImei() {
		return gpsImei;
	}

	public void setGpsImei(String gpsImei) {
		this.gpsImei = gpsImei;
	}

	public int getAddress() {
		return address;
	}

	public void setAddress(int address) {
		this.address = address;
	}

	public String getVehicleNo() {
		return vehicleNo;
	}

	public void setVehicleNo(String vehicleNo) {
		this.vehicleNo = vehicleNo;
	}

	public String getPlateColor() {
		return plateColor;
	}

	public void setPlateColor(String plateColor) {
		this.plateColor = plateColor;
	}

	public String getSeats() {
		return seats;
	}

	public void setSeats(String seats) {
		this.seats = seats;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getVehicleType() {
		return vehicleType;
	}

	public void setVehicleType(String vehicleType) {
		this.vehicleType = vehicleType;
	}

	public String getOwnerName() {
		return ownerName;
	}

	public void setOwnerName(String ownerName) {
		this.ownerName = ownerName;
	}

	public String getVehicleColor() {
		return vehicleColor;
	}

	public void setVehicleColor(String vehicleColor) {
		this.vehicleColor = vehicleColor;
	}

	public String getEngineId() {
		return engineId;
	}

	public void setEngineId(String engineId) {
		this.engineId = engineId;
	}

	public Long getVin() {
		return vin;
	}

	public void setVin(Long vin) {
		this.vin = vin;
	}

	public int getCertifyDateA() {
		return certifyDateA;
	}

	public void setCertifyDateA(int certifyDateA) {
		this.certifyDateA = certifyDateA;
	}

	public String getFuelType() {
		return fuelType;
	}

	public void setFuelType(String fuelType) {
		this.fuelType = fuelType;
	}

	public String getEngineDisplace() {
		return engineDisplace;
	}

	public void setEngineDisplace(String engineDisplace) {
		this.engineDisplace = engineDisplace;
	}

	public String getTransAgency() {
		return transAgency;
	}

	public void setTransAgency(String transAgency) {
		this.transAgency = transAgency;
	}

	public String getTransArea() {
		return transArea;
	}

	public void setTransArea(String transArea) {
		this.transArea = transArea;
	}

	public int getTransDateStart() {
		return transDateStart;
	}

	public void setTransDateStart(int transDateStart) {
		this.transDateStart = transDateStart;
	}

	public int getTransDateStop() {
		return transDateStop;
	}

	public void setTransDateStop(int transDateStop) {
		this.transDateStop = transDateStop;
	}

	public int getCertifyDateB() {
		return certifyDateB;
	}

	public void setCertifyDateB(int certifyDateB) {
		this.certifyDateB = certifyDateB;
	}

	public String getFixState() {
		return fixState;
	}

	public void setFixState(String fixState) {
		this.fixState = fixState;
	}

	public int getCheckState() {
		return checkState;
	}

	public void setCheckState(int checkState) {
		this.checkState = checkState;
	}

	public String getFeePrintId() {
		return feePrintId;
	}

	public void setFeePrintId(String feePrintId) {
		this.feePrintId = feePrintId;
	}

	public String getGpsBrand() {
		return gpsBrand;
	}

	public void setGpsBrand(String gpsBrand) {
		this.gpsBrand = gpsBrand;
	}

	public String getGpsModel() {
		return gpsModel;
	}

	public void setGpsModel(String gpsModel) {
		this.gpsModel = gpsModel;
	}

	public int getGpsInstallDate() {
		return gpsInstallDate;
	}

	public void setGpsInstallDate(int gpsInstallDate) {
		this.gpsInstallDate = gpsInstallDate;
	}

	public int getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(int registerDate) {
		this.registerDate = registerDate;
	}

	public int getCommercialType() {
		return commercialType;
	}

	public void setCommercialType(int commercialType) {
		this.commercialType = commercialType;
	}

	public String getFareType() {
		return fareType;
	}

	public void setFareType(String fareType) {
		this.fareType = fareType;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public static OTIpcDef.BaseInfoVehicle convert(BaseInfoVehicle data){
        OTIpcDef.BaseInfoVehicle item = OTIpcDef.BaseInfoVehicle.newBuilder()
                .setCompanyId(data.getCompanyId())
                .setAddress(data.getAddress())
                .setVehicleNo(data.getVehicleNo())
                .setPlateColor(data.getPlateColor())
                .setSeats(Integer.parseInt(data.getSeats()))
                .setBrand(data.getBrand())
                .setModel(data.getModel())
                .setVehicleType(data.getVehicleType())
                .setOwnerName(data.getOwnerName())
                .setVehicleColor(data.getVehicleColor())
                .setEngineId(data.getEngineId())
                .setVIN(data.getVin().toString())
                .setCertifyDateA(Long.valueOf(data.getCertifyDateA()))
                .setFuelType(data.getFuelType())
                .setEngineDisplace(data.getEngineDisplace())
                .setTransAgency(data.getTransAgency())
                .setTransArea(data.getTransArea())
                .setTransDateStart(Long.valueOf(data.getTransDateStart()))
                .setTransDateStop(Long.valueOf(data.getTransDateStop()))
                .setCertifyDateB(Long.valueOf(data.getCertifyDateB()))
                .setFixState(data.getFixState())
                .setCheckState(data.getCheckState()+"")
                .setFeePrintId(data.getFeePrintId())
                .setGPSBrand(data.getGpsBrand())
                .setGPSModel(data.getGpsModel())
                .setGPSInstallDate(Long.valueOf(data.getGpsInstallDate()))
                .setRegisterDate(Long.valueOf(data.getRegisterDate()))
                .setCommercialType(data.getCommercialType())
                .setFareType(data.getFareType())
                .setState(data.getState())
                .setFlag(data.getFlag())
                .setUpdateTime(Long.valueOf(data.getUpdateTime()))
                .setCertificate(data.getCertificate())
	            .setPhotoId(data.getPhotoId())
	            .setGPSIMEI(data.getGpsImei())
                .build();

        return item;
    }
	
	
	public  static BaseInfoVehicle convertPojo(OTIpcDef.BaseInfoVehicle data){
		BaseInfoVehicle biv=new BaseInfoVehicle();
		biv.setAddress(data.getAddress());
		biv.setBrand(data.getBrand());
		biv.setCertifyDateA((int)data.getCertifyDateA());
		biv.setCertifyDateB((int)data.getCertifyDateB());
		biv.setCheckState(Integer.parseInt(data.getCheckState()));
		biv.setCommercialType(data.getCommercialType());
		biv.setCompanyId(data.getCompanyId());
		biv.setEngineDisplace(data.getEngineDisplace());
		biv.setEngineId(data.getEngineId());
		biv.setFareType(data.getFareType());
		biv.setFeePrintId(data.getFeePrintId());
		biv.setFixState(data.getFixState());
		biv.setFlag(data.getFlag());
		biv.setFuelType(data.getFuelType());
		biv.setGpsBrand(data.getGPSBrand());
		biv.setGpsInstallDate((int)data.getGPSInstallDate());
		biv.setGpsModel(data.getGPSModel());
		biv.setModel(data.getModel());
		biv.setOwnerName(data.getOwnerName());
		biv.setPlateColor(data.getPlateColor());
		biv.setRegisterDate((int)data.getRegisterDate());
		biv.setSeats(data.getSeats()+"");
		biv.setState(data.getState());
		biv.setTransAgency(data.getTransAgency());
		biv.setTransArea(data.getTransArea());
		biv.setTransDateStart((int)data.getTransDateStart());
		biv.setTransDateStop((int)data.getTransDateStop());
		biv.setUpdateTime(data.getUpdateTime());
		biv.setVehicleColor(data.getVehicleColor());
		biv.setVehicleNo(data.getVehicleNo());
		biv.setVehicleType(data.getVehicleType());
		biv.setVin(Long.valueOf(data.getVIN()));
		biv.setPhotoId(data.getPhotoId());
		biv.setCertificate(data.getCertificate());
		biv.setGpsImei(data.getGPSIMEI());
		return biv;
	}
	 
}
